package com.qingbo.wu.oss.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.qingbo.wu.oss.service.FileService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: qingbo.wu
 * @Date: 2024/6/1 17:07
 * @Description:
 */
@RestController
public class FileController {

    @Resource
    private FileService fileService;

    @NacosValue(value = "${storage.service.type}",autoRefreshed = true)
    private String storageType;


    @RequestMapping("/testGetAllBuckets")
    public String testGetAllBuckets() throws Exception{
        List<String> allBuckets = fileService .getAllBuckets();
        return allBuckets.get(0);
    }


    @RequestMapping("/testNacos")
    public String testNacos() throws Exception{
        return this.storageType;
    }
}
